package com.resms.saas.api.bean;

import java.util.Objects;

/**
 * 泛型3元组
 * Created by sam on 2019/5/28.<br >
 */
public class Tuple3<F,S,O> {
    private final F key;
    private final F value;
    private final O other;

    public Tuple3(F key, F value, O other) {
        this.key = key;
        this.value = value;
        this.other = other;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tuple3<?, ?, ?> tuple3 = (Tuple3<?, ?, ?>) o;
        return key.equals(tuple3.key) &&
                value.equals(tuple3.value) &&
                other.equals(tuple3.other);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value, other);
    }

    public F getKey() {
        return key;
    }

    public F getValue() {
        return value;
    }

    public O getOther() {
        return other;
    }
}
